<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SQLRelay</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">

<p><a name="__index__"></a></p>
<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#usage">USAGE</a></li>
	<ul>

		<li><a href="#note_for_html__mason_users">Note for HTML::Mason Users</a></li>
	</ul>

	<li><a href="#author">AUTHOR</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>DBD::SQLRelay - perl DBI driver for SQL Relay</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<p>use DBD::SQLRelay;</p>
<p>my $dbh = DBI -&gt; connect ('dbi:SQLRelay:$dsn', $login, $password);</p>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>This module is a pure-Perl DBI binding to SQL Relay's native API. 
Connection string consists of following parts:</p>
<dl>
<dt><strong><a name="item_host_3d_2e_2e_2e_default_3a_localhost__2d_2d_2d_ho"><strong>host=...</strong>      default: <em>localhost</em> --- hostname of SQL Relay server;</a></strong>

<dt><strong><a name="item_port_3d_2e_2e_2e_default_3a_9000__2d_2d_2d_port_nu"><strong>port=...</strong>      default: <em>9000</em>      --- port number that SQL Relay server listens on;</a></strong>

<dt><strong><a name="item_tries_3d_2e_2e_2e_default_3a_1__2d_2d_2d_how_much_"><strong>tries=...</strong>     default: <em>1</em>         --- how much times do we try to connect;</a></strong>

<dt><strong><a name="item_time"><strong>retrytime=...</strong> default: <em>0</em>         --- time (in seconds) between connect attempts;</a></strong>

<dt><strong><a name="item_debug_3d_2e_2e_2e_default_3a_0__2d_2d_2d_set_it_to"><strong>debug=...</strong>     default: <em>0</em>         --- set it to 1 if you want to get some debug messages in stdout;</a></strong>

</dl>
<p>
</p>
<hr />
<h1><a name="usage">USAGE</a></h1>
<p>Once connected, DB handler works as usual (see <em>DBI</em>).</p>
<p>Don't ever try to share one SQLRelay connect by multiple scripts, for example, if you use 
Apache mod_perl. Every $dbh holds one of server connections, so call <code>disconnect()</code> directly
at the end of every script and don't use Apache::DBI or SQLRelay will be deadlocked.</p>
<p>
</p>
<h2><a name="note_for_html__mason_users">Note for HTML::Mason Users</a></h2>
<p>If you use <a href="/HTML/Mason.html">the HTML::Mason manpage</a>, your handler.pl sould look like this:</p>
<pre>
  ...</pre>
<pre>
     {
       package HTML::Mason::Commands;
       use DBI;
       use vars qw($db);  
     }
 
  ...</pre>
<pre>
     sub handler {
       
       $HTML::Mason::Commands::dbh = DBI -&gt; connect (...);
       
       my $status = $ah -&gt; handle_request (...);
     
       $HTML::Mason::Commands::dbh -&gt; disconnect;
       
       return $status;
              
     }</pre>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>D. E. Ovsyanko, <a href="mailto:do@mobile.ru">do@mobile.ru</a></p>
<p>Contributions by:</p>
<p>Erik Hollensbe &lt;<a href="mailto:erik@hollensbe.org">erik@hollensbe.org</a>&gt;</p>
<p>Tony Fleisher &lt;<a href="mailto:tfleisher@musiciansfriend.com">tfleisher@musiciansfriend.com</a>&gt;</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="http://www.firstworks.com">http://www.firstworks.com</a></p>

</body>

</html>
